$(function() {
	basic.hover(head.menuLI, {
		"cursor" : "pointer",
		"background-color" : '#0f69a3'
	}, {
		"cursor" : "default",
		"background-color" : '#1170b2'
	});
	
	basic.hover("#head_nickName,#head_logout",{
        "cursor" : "pointer",
        "color" : "#1170b2",
        "text-decoration" : "underline"
    }, {
        "cursor" : "default",
        "color" : "black",
        "text-decoration" : "none"
    });
	//签到点击
	$(head.menuLI+":last").click(function() {
		head.checkIn();
	});
	
	$(head.button+":eq(0)").click(function(){
		window.open(basic.addr+"login.html",'_self');
	});
	$(head.button+":eq(1)").click(function(){
	   window.open(basic.addr+"enroll.html",'_self');
	});
});
// 签到
var head = {
    button:".head_input_button",
    menuLI:".head_menu_ul li",
	checkIn : function() {
		$.ajax({
			url : basic.addr + 'indexCheckIN.html',
			dataType : 'json',
			cache : false,
			success : function(data) {
				if (data.key === 0) {
					$.messager.alert("提示",'你还未登陆','info');
				} else if (data.key === 20) {
					$.messager.alert("提示",'签到成功','info');
				}
				if (data.key === 11) {
				$.messager.alert("提示",'今日已签到','info');
				}
			},
			error : function() {
				$.messager.alert("提示",'系统繁忙，请稍后再试。。。','info');
			}
		});
	}
};
